(function () {

})();

function insightPMonitor() {
	try {	
	var nag = $(".CurrChnlCls");
	var size = nag.size();
	var webZone = "";
	var easyRem = "";
	var zone2 = "";
	var zone3 = "";
	var product = "";
	var events = "";
	var nameArray = [ "澧冨唴鑷┚娓�", ";e-绁炲窞鑷┚娓镐繚闄�", "澧冨唴鑷姪娓�", ";e-绁炲窞閫嶉仴娓镐繚闄�", "澧冨唴鍟嗗姟鍑鸿",
			";e-绁炲窞鍟嗗姟琛屼繚闄�", "澧冨鑷姪娓�", ";e-鍥涙捣閫嶉仴娓镐繚闄�", "澧冨鍟嗗姟鍑鸿", ";e-鍥涙捣鍟嗗姟琛屼繚闄�",
			"鑸┖鎰忓骞村害闄�", ";鑸┖鏃呭鎰忓浼ゅ骞村害淇濋櫓", "浜ら€氬伐鍏锋剰澶栭櫓", ";鈥渆-鍑鸿鏃犲咖鈥濅繚闄�", "浜鸿韩鎰忓闄�",
			";鈥渆-閮藉競鐧介鈥濅汉韬剰澶栦激瀹充繚闄�", "缇庢弧e瀹剁粍鍚堥櫓", ";鈥滅編婊瀹垛€濊嚜鍔╁紡缁勫悎淇濋櫓", "e-浜哄眳涓ゆ椇闄�",
			";鈥渆-浜哄眳涓ゆ椇鈥濊嚜鍔╁紡缁勫悎淇濋櫓", "鐩戞姢浜鸿矗浠婚櫓", ";鐩戞姢浜鸿矗浠讳繚闄�", "瀹犵墿璐ｄ换闄�", ";瀹犵墿璐ｄ换淇濋櫓",
			"鐢虫牴绛捐瘉", ";鐢虫牴绛捐瘉淇濋櫓", "鍥藉唴楂樺師娓�", ";e-鍥藉唴楂樺師娓�", "鍥藉唴鍏矾闅忚溅琛屾潕淇濋櫓",
			";鍥藉唴鍏矾闅忚溅琛屾潕淇濋櫓", "鍥藉唴鑸┖鏃呭琛屾潕淇濋櫓", ";鍥藉唴鑸┖鏃呭琛屾潕淇濋櫓", "鑸彮寤惰淇濋櫓",
			";鑸┖寤惰鎹熷け缁煎悎淇濋櫓", "e瀹舵棤蹇у璐㈤櫓", ";鈥渆瀹舵棤蹇р€濅繚闄�" ];

	var array2Copy = "";
	var nameArray2 = [ "淇濋櫓妗堜緥:杞﹂櫓", "淇濋櫓妗堜緥:鏃呮父淇濋櫓", "淇濋櫓妗堜緥:鎰忓淇濋櫓", "淇濋櫓妗堜緥:瀹跺涵淇濋櫓",
			"淇濋櫓璧勮:琛屼笟璧勮", "淇濋櫓璧勮:姹借溅璧勮", "淇濋櫓璧勮:鏃呮父璧勮", "淇濋櫓璧勮:浜ら€�&鑸┖璧勮",
			"淇濋櫓璧勮:瀹跺涵&璐骇璧勮", "淇濋櫓璧勮:鍑哄璧勮", "淇濋櫓璧勮:鍟嗗姟琛岃祫璁�", "鍏徃鍔ㄦ€�" ];

	if (size <= 1) {
		webZone = "缃戠珯棣栭〉";
		easyRem = webZone;
		zone2 = webZone;
		zone3 = webZone;
	} else {
		webZone = nag.eq(1).text();
		for (i = 1; i < size; i++) {

			easyRem = easyRem + nag.eq(i).text() + ":";
		}
		easyRem = easyRem.substring(0, easyRem.length - 1);
		var array = easyRem.split(":");
		if (array.length > 1) {
			zone2 = array[0] + ":" + array[1];
			if (array.length > 2) {
				zone3 = array[0] + ":" + array[1] + ":" + array[2];
				array2Copy = array[2];
			} else {
				zone3 = zone2;
			}
		} else {
			zone2 = easyRem;
			zone3 = easyRem;
		}
	}
	if (zone3.indexOf("鏈哄姩杞﹁締淇濋櫓") > -1) {
		insightCPMonitor();
		return false;
	}

	var indexFlag = false;
	for (i = 0; i < nameArray2.length; i++) {
		if (easyRem.indexOf(nameArray2[i]) > -1) {
			indexFlag = true;
			break;
		}
	}
	if (indexFlag == true) {
		s_picc.pageName = easyRem + ":" + $(document).attr("title");//
	} else {
		s_picc.pageName = easyRem;
	}

	s_picc.channel = webZone;
	s_picc.prop1 = zone2;
	s_picc.prop2 = zone3;
	
	/*<%--  娉ㄩ噴寮€濮�
	s_picc.server = "";
	s_picc.pageType = "";
	s_picc.prop3 = "";
	s_picc.prop4 = "";
	s_picc.prop5 = "";
	// Conversion Variables
	s_picc.campaign = "";
	s_picc.state = "";
	s_picc.zip = "";
	// s_picc.events="event8"

	if (zone3.indexOf("閫夎喘淇濋櫓") > -1) {
		if (zone3.indexOf("鏈哄姩杞﹁締淇濋櫓") > -1) {
			product = ";瀹跺涵鑷敤杞︿繚闄�";
			events = "prodView";
		} else {
			for (i = 0; i < nameArray.length; i++) {
				if (nameArray[i] == array2Copy) {
					product = nameArray[i + 1];
					events = "prodView";
					break;
				}
			}
		}

	} else {
		product = "";
		events = "";
	}

	var agenttypeinuml = getQueryStringOM('agenttypeinuml') == null ? "" : getQueryStringOM('agenttypeinuml');

	if (agenttypeinuml != "") {
		if (agenttypeinuml == "01") {
			s_picc.eVar10 = "鍥㈣喘:闈炶溅闄�:浼佷笟鍥㈣喘";
		} else if (agenttypeinuml == "02") {
			s_picc.eVar10 = "鍥㈣喘:闈炶溅闄�:鏁ｅ崟鍥㈣喘";
		} else if (agenttypeinuml == "05") {
			s_picc.eVar10 = "鍥㈣喘:闈炶溅闄�:绗笁鏂圭綉绔�";
		} else if (agenttypeinuml == "09") {
			s_picc.eVar10 = "鍥㈣喘:闈炶溅闄�:鍩庣綉涓氬姟";
		}
	}

	s_picc.products = product;
	s_picc.events = events;
	s_picc.purchaseID = "";
	s_picc.eVar1 = easyRem;
	s_picc.eVar2 = "";
	s_picc.eVar3 = "";
	s_picc.eVar4 = "";
	s_picc.eVar5 = "";
	
	娉ㄩ噴缁撴潫 --%>*/
	s_picc.t();
	
	} catch (e) {

	}	
}

function insightCPMonitor() {
	try {	
	s_picc.pageName = "閫夎喘淇濋櫓:鏈哄姩杞﹁締淇濋櫓";
	s_picc.channel = "閫夎喘淇濋櫓";
	s_picc.prop1 = "閫夎喘淇濋櫓:鏈哄姩杞﹁締淇濋櫓";
	s_picc.prop2 = "閫夎喘淇濋櫓:鏈哄姩杞﹁締淇濋櫓";
	
	/*<%--  娉ㄩ噴寮€濮�
	s_picc.server = "";
	s_picc.pageType = "";
	s_picc.prop3 = "";
	s_picc.prop4 = "";
	s_picc.prop5 = "";
	// Conversion Variables;
	s_picc.campaign = "";
	s_picc.state = "";
	s_picc.zip = "";
	// s_picc.events="event8";
	s_picc.products = ";瀹跺涵鑷敤杞︿繚闄�";
	s_picc.purchaseID = "";
	s_picc.eVar1 = "閫夎喘淇濋櫓:鏈哄姩杞﹁締淇濋櫓";
	s_picc.eVar2 = "";
	s_picc.eVar3 = "";
	s_picc.eVar4 = "";
	s_picc.eVar5 = "";

	checkCrossSellOrSeatLinks();
	娉ㄩ噴缁撴潫 --%>*/
	
	s_picc.t();
	} catch (e) {

	}	
}

function getQueryStringOM(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r = window.location.search.substr(1).match(reg);
	if (r != null)
		return unescape(r[2]);
	return null;
}

function checkCrossSellOrSeatLinks() {
	var thisurl = window.location.href;
	if (thisurl.indexOf("ID") > -1) {
		var str = "ID";
		var Id = GetQueryString("ID");
		$.ajax({
			type : "get",
			url : "/ecar/proposal/checkCrossSellOrSeatLinks?zxID=" + Id + "&time=" + new Date().getTime(),
			dataType : "json",
			async : false,
			success : function(data) {
				if (data != null && "" != data) {
					s.eVar10 = "鍥㈣喘:杞﹂櫓:" + data;
				}
			},
			error : function() {
			}
		});
	}
}
